home *** CD-ROM | disk | FTP | other *** search
- DATES.DOC
- 01/07/95
-
- This program keeps track of birthdays, anniversaries, coming events, etc giving
- you advance warning so you can send out cards, leave town, etc. Features of
- this program:
-
- * Initially defaults to showing all events happening within 14 days
- * You can set up multiple date files, each with their own day threshold;
- for example, one file for birthdays, another for business meetings, etc
- * You can establish a different threshold on an event-by-event basis if
- desired.
- * This program can be included in your AUTOEXEC.BAT file to provide notices
- every time you turn on your PC.
- * You can specify dates like the "last Thursday" or the "first Monday" of
- a given month.
- * Vague dates can be entered (e.g. "04/XX/XX Easter") when the exact day
- varies from year to year.
- * Dates can be in the United States format (/DATE=mm/dd/yy) or in most other
- formats (e.g. /DATE=dd-mm-yy).
- * Months can be entered as sequential months (1 for January, 2 for February,
- etc) or else entered as the months themselves (JAN, FEB, etc).
- * Dates don't have to be padded (9/6/94, 09/06/94, and SEP/06/1994 are all
- accepted).
- * The program will show you the weekday, age, and/or days until the event
- if desired.
- * Comment lines can be displayed if desired (e.g. "Events relating to work:")
- * The program can automatically pause when done or after a set number of
- lines if desired.
- * Entries can be sorted before display based on their "date difference" (the
- number of days before the event occurs) or in their original order.
-
- The dates file is a simple ASCII text file, created and maintained with any text
- editor. Each record should begin with a date (typically in mm/dd/yy format)
- followed by a description of the event. For example:
-
- 05/05/93 Lucy Baines
-
- Blank lines or any line which begins with a colon (":") or semi-colon (";") are
- ignored by the program. Lines which begin with an asterisk ("*") are printed
- verbatim (minus the asterisk); add spacing after the asterisk if you want the
- lines to be indented upon display. Note: Comments will be ignored if /SORT
- is specified.
-
- For the date portion of the record, you have some flexibility. By default, the
- program expects dates to be in a mm/dd/yy format. So August 5, 1993 is
- "08/05/93".
-
- You can change the sequence of the numbers by using the "/DATE=format" option.
- For example, you can specify "/DATE=dd-mm-yy" if you want.
-
-
- Typically, most date formats will use one of the delimiters "-", ".", or "/"
- between all various day, month, and year fields. For example, /DATE=dd.mm.yy
- instead of /DATE=dd.mm/dd. If this is done, your input fields can entered in a
- very flexible manner. The routine will parse the date field based on the
- delimiters and accept fields with or without padding, years with or without the
- century, and alphabetic months instead of just numeric ones. For example, using
- /DATE=dd.mm.yy, all of the following September 5, 1994 events are the same:
-
- 05.09.94 Big event
- 5.9.94 Same event
- 5.sep.1994 Still the same thing
- 05.september.1994 And yet again the same event
-
- If you want, you can specify a day of the month based on a relative weekday
- within the month. For example, in the United States, Thanksgiving falls on the
- last Thursday in November and Father's Day is the third Sunday in June.
-
- If it's a relative weekday from the beginning of the month, DATES allows you to
- enter these in the "day" field by using "nww" where "n" indicates the sequence
- of the weekday (if you leave it off, it's presumed to be the first) and "ww" is
- the first two letters of the day. If it's a relative weekday from the end of
- the month, use "Lnww" ("n" defaults to 1).
-
- So, for these two examples, they can be entered in your file as:
-
- 11/LTH/XX Thanksgiving
- 06/3SU/XX Father's Day
-
- The month portion of the date *has* to be filled in. The day and year portions
- can be "xx" if desired. If a day is "xx", you will be given the notice for the
- entire month and for 15 days before the start of the month. For dates which
- vary from year to year and which can't be done using something like "LTH" or
- "2MO" (primarily Easter) you can either use the "xx" option for the day or
- revise the file every year.
-
- Records in the file don't have to be in any particular order. The dates will be
- presented in the order they appear in the file so putting them in chronological
- order makes the most sense.
-
- There's an initial age threshold for each input dates files. Thus you could
- have a birthday dates file and ask for 14 days warning for each event in it and
- have a separate file for important job-related functions that has perhaps a
- 30-day warning. Additionally, you can specify age thresholds on an
- event-by-event basis by beginning the relevant descriptions with "/Ddays" (e.g.
- "11/01/95 /D60 BIG meeting!"). Specific age thresholds like this are not
- overridden by the "/Ddays" parameter specified from the command line.
-
-
- In addition to being able to specify "/Ddays" on an event-by-event basis,
- certain command-line parameters can be imbedded within the dates input file.
- See the discussion about "Syntax" later for a description of these parameters.
- These parameters must begin in the first column of the line and only one
- parameter can be specified on a line. These parameters override one or more
- defaults for the current input file only and can be set and reset throughout the
- file. The acceptable parameters are:
-
- /Ddays (can also be specified for an individual event)
- /DATE=format
- /DATE and /-DATE
- /DAY and /-DAY (same as /WEEKDAY and /-WEEKDAY)
- /AGE and /-AGE
- /CTDOWN and /-CTDOWN
- /COLOR=nnn nnn nnn nnn
-
- For example:
-
- 01/01/XX A stellar new years event
- /-AGE
- /-DAY
- 01/20/92 Expect the unexpected!
- 01/22/94 Another one (still covered by same parameters)
- /AGE
- 01/23/94 Skipping age on this one
- /-AGE
- 01/25/94 And reinstating it here
-
- A sample United States-oriented DATES.TXT file is provided and consists of the
- following lines:
-
- 01/01/xx New Year's Day
- 01/3MO/xx Martin Luther King's birthday
- 02/14/xx Valentine's Day
- 03/17/xx St. Patrick's Day
- 03/30/xx -ish Easter
- 04/07/xx -ish Daylight Savings Time begins
- 05/2SU/xx Mother's Day
- 05/LMO/xx Memorial Day
- 05/31/57 Bruce Guthrie
- 07/04/xx July 4th
- 09/1MO/xx Labor Day
- 10/27/xx -ish Daylight Savings Time ends
- 10/31/xx Halloween
- 11/11/xx Veteran's Day
- 11/4TH/xx Thanksgiving
- 12/25/xx Christmas
-
- As far as the actual display of the information is concerned, each event is
- typically presented as just "date event", where any relative day references like
- "4TH" get resolved before the date is shown. For example, presume it's May 25
- in 1994, /D14 is in effect, and your input file has the following three lines:
-
- 05/28/30 Mr.Fury
- 05/LMO/xx Memorial Day
- 05/31/57 Bruce Guthrie
-
-
- The initial display settings are /DATE /-DAY /-AGE /-CTDOWN. This presents the
- information as:
-
- 05/28/30 Mr.Fury
- 05/30/xx Memorial Day
- 05/31/57 Bruce Guthrie
-
- See the syntax descriptions for what each of these settings mean. Changing the
- settings to /-DATE /DAY /AGE /CTDOWN presents it as:
-
- [Sat] (64th) 3 days until Mr.Fury
- [Mon] 5 days until Memorial Day
- [Tue] (37th) 6 days until Bruce Guthrie
-
-
- Multiple input files with different date restrictions:
-
- You can specify multiple date input files. They are processed in the order
- they are entered. By default, each will have the initial date restriction
- (typically 14 days). You can override the date restriction for a specific file
- by including the date restriction after the file name. For example:
-
- DATES DATE1.TXT DATE2.TXT /D10 DATE3.TXT
-
- Given a default 14-day restriction, the date restrictions will be 14 days for
- DATE1.TXT and DATE3.TXT, 10 days for DATE2.TXT. If you want to override the
- date restriction for all files, include that date restriction before the file
- name. For example:
-
- DATES /D5 DATE1.TXT DATE2.TXT /D10 DATE3.TXT
-
- In this case, the date restriction will be 5 days for DATE1.TXT and DATE3.TXT
- and 10 days for DATE2.TXT.
-
-
-
- Specifying parameters:
-
- Parameters for this program can be set in the following ways. The last setting
- encountered always wins:
- - Read from an *.INI file (see below),
- - Through the use of an environmental variable (SET DATES=whatever), or
- - From the command line (see "Syntax" below)
-
-
- The DATES.INI file:
-
- DATES will read a DATES.INI file if one is found. (You can specify a different
- file name if desired.) The file is an ASCII text file that can be created
- maintained by hand. The file can consist or one or more command line
- parameters (only those that begin with a "/"; no multi-word ones), one statement
- per line.
-
- The file can also contain comments which are blank lines or any line beginning
- with:
- ; (semi-colon)
- : (colon)
- ' (quote)
-
- DATES looks for the initialization file in your default subdirectory first. It
- then searches for it in the subdirectory where the executable was and then goes
- through your DOS path.
-
- Passing in "/-I" or "/INULL" skips loading the INI file. This saves some
- execution time as the program does not need to search your path for the file.
-
-
-
- Syntax:
-
- DATES [ date_file [...] ] [ /Ddays ] [ /SKIP | /-SKIP ] [ /DATE=format ]
- [ /DATE | /-DATE ] [ /DAY | /-DAY ] [ /AGE | /-AGE ] [ /CTDOWN | /-CTDOWN ]
- [ /COLOR=nnn nnn nnn ] [ /MONO | /COLOR ] [ /Q | /-Q ] [ /SORT | /-SORT ]
- [ /GLOBAL | /-GLOBAL ] [ /CLS | /-CLS ] [ /P | /Pn | /-P ]
- [ /W | /W0 | /-W ] [ /R ] [ /Iinitfile | /-I ] [ /? ] [ > filename ]
-
- where:
-
- "date_file" is the name of the input text file. It can contain drive and path
- information if desired. This defaults to DATES.TXT. If no filename is
- specified, the program will check for it along your DOS path beginning with your
- default subdirectory. Multiple date files and date restrictions are allowed.
- See the notes above about this.
-
- "/Ddays" (or "days") are the number of days in advance you want the warning.
- Initially defaults to /D14. Generic days ("11/xx/xx") are not affected by this
- setting; you automatically get the notice 15 days before the beginning of the
- month and through the entire month itself. Events coded with specific "/Ddays"
- entries are also not affected by the command-line "/Ddays" setting.
-
- "/SKIP" says to print a message (unless /Q is specified) but otherwise ignore
- it if one or more of the date input files is not found.
-
- "/-SKIP" says to abort if any of the input files are not found.
-
- "/DATE=format" specifies the format that the date is to have. The date must
- consist of pairs of "mm" (month), "dd" (day), and "yy" (year) characters in any
- order. If a delimiter is used between the pairs, it can be any non-space
- character (like "-" or "/"). If your delimiter is the same between the three
- sets of date portions (e.g. /DATE=mm/dd/yy or /DATE=dd.mm.yy), you have a
- considerable amount of flexibility in terms of what sort of entries can appear.
- See the notes at the beginning of this documentation. Initially defaults to
- "/DATE=mm/dd/yy".
-
- "/DATE" indicates that the date is to be presented if the entry is show.
- This is initially the default.
-
- "/-DATE" skips showing the date of the event when it's displayed.
-
- "/DAY" (or "/WEEKDAY") shows the day of the week for each event if possible.
-
- "/-DAY" (or "/-WEEKDAY") skips showing the day of the week. This is initially
- the default.
-
- "/AGE" shows the age of the event when it's displayed. This is only done for
- entries that have a specific year. This is initially the default.
-
- "/-AGE" skips showing the age of the event.
-
- "/CTDOWN" adds a "x days until" message in front of any displayed event.
-
- "/-CTDOWN" skips adding the "x days until" message. This is initially the
- default.
-
-
- "/COLOR=nnn nnn nnn" specifies the color settings to use for (in order) regular
- text, dates happening today, and the ages of dates happening today. Any input
- lines which begin with an asterisk are printed using the third color set. Each
- setting must consist of three digits, the first two being the foreground color
- and the last being the background color. The foreground color should be padded
- on the left with a 0 if it is only one digit in length. Defaults to "COLOR=070
- 150 090".
-
- Foreground colors:
-
- Low intensity High intensity
-
- 0 = black 8 = dark grey
- 1 = blue 9 = light blue
- 2 = green 10 = light green
- 3 = cyan 11 = light cyan
- 4 = red 12 = light red
- 5 = magenta 13 = light magenta
- 6 = brown 14 = light yellow
- 7 = white 15 = bright white
-
- Adding 16 to any color will make the text blink. Background colors can consist
- of 0 to 7 above. Bright white on blue, for example, would be "151".
-
- "/MONO" suppresses all screen color settings.
-
- "/COLOR" allows screen color settings and is initially the default.
-
- "/Q" stops the printing every message except for the actual date lines. This
- option is automatically invoked if redirection is used.
-
- "/-Q" turns back on the printing of almost every message. This is the initially
- default unless redirection is used.
-
- "/SORT" sorts the entries by their date difference (the number of days between
- now and the date of the event). If you're using more than one dates file with
- the "/-GLOBAL" (default) parameter, all appropriate entries from a given dates
- file will be sorted and displayed before any entries from the next dates file
- are displayed. The "/GLOBAL" parameter will combine them all before sorting
- them. Using "/SORT" precludes you from showing any display comments (lines
- beginning with "*") in your file. Currently, the program limits you to
- displaying 100 items per input file if /SORT is specified; let me know if this
- limit is too low for you.
-
- "/-SORT" says to display the entries as they're found in the files. This is
- initially the default.
-
- "/GLOBAL" invokes "/SORT" and merges multiple date input files if found, sorting
- them as a unit instead of individually.
-
- "/-GLOBAL" treats each date input file as a unique entity for sorting purposes.
- This is initially the default.
-
- "/CLS" clears the display before showing the results.
-
- "/-CLS" does not clear the display first. This is the default.
-
-
- "/P" says to pause the output every 23 lines. (NOTE: The /P, /Pn, and /-P
- options affect pausing while listing events; the /W, /W0, /-W options affect
- pausing after the program finishes.)
-
- "/Pn" says to pause the output every n-number of lines.
-
- "/-P" says to not pause the output at all. This is initially the default.
-
- "/W" says to pause with a "Press any key to continue" message after the
- program finishes if any hits were found.
-
- "/W0" says to pause afterward whether any hits were found or not.
-
- "/-W" says to not pause afterward at all. This is initially the default.
-
- "/R" sets a DOS return code equal to the number of dates found. The standard
- way to use something like this is with a test on the DOS ERRORLEVEL in an
- AUTOEXEC.BAT file or something. For example:
-
- DATES /R
- IF ERRORLEVEL 1 GOTO HITS
- GOTO END
- :HITS
- PAUSE
- :END
- ECHO DONE
-
- Note that the results of particular example could have been done easier using
- DATES' /W parameter.
-
- "/Iinitfile" says to read an initialization file with the file name "initfile".
- The file specification *must* contain a period. If no drive or path information
- is specified, the program will search for initfile beginning in your default
- subdirectory and then going throughout your DOS path. The use of an
- initialization file is optional. Initially defaults to "/IDATES.INI".
-
- "/-I" (or "/INULL") says to skip loading the initialization file.
-
- "/?" or "/HELP" or "HELP" shows you the syntax for the command.
-
- "> filename" redirects the output to a DOS file. This is standard DOS
- redirection. Automatically invokes /Q option and turns off the last of the
- status messages.
-
-
- Return codes:
-
- DATES returns the following ERRORLEVEL codes:
- 255 = syntax problems, or /? requested
-
- If /R is specified, the ERRORLEVEL code will be the number of hits found.
-
-
-
- Author:
-
- This program was written by Bruce Guthrie of Wayne Software. It is free for use
- and redistribution provided relevant documentation is kept with the program, no
- changes are made to the program or documentation, and it is not bundled with
- commercial programs or charged for separately. People who need to bundle it in
- for-sale packages must pay a $50 registration fee to "Wayne Software" at the
- following address.
-
- Additional information about this and other Wayne Software programs can be found
- in the file BRUCEymm.DOC which should be included in the original ZIP file.
- ("ymm" is replaced by the last digit of the year and the two digit month of the
- release. BRUCE312.DOC came out in December 1993. This same naming convention
- is used in naming the ZIP file that this program was included in.) Comments and
- suggestions can also be sent to:
-
- Bruce Guthrie
- Wayne Software
- 113 Sheffield St.
- Silver Spring, MD 20910
-
- fax: (301) 588-8986
-
- See BRUCEymm.DOC file for additional contact information.
-
- Foreign users: Please provide an Internet e-mail address in all correspondence.
-